/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package reticulado;

/**
 *
 * @author Santiago Avendaño
 */
public class NullNode extends AbstractNode {

    private NullNode() {
    }

    public static NullNode getInstance() {
        return NullNodeHolder.instance;
    }

    private static class NullNodeHolder {
        private final static NullNode instance = new NullNode();
    }

    @Override
    public String toString() {
        return "Null";
    }

    @Override
    public int compareTo(Object o) {
        if (o == null) {
            return 1;
        }
        if (getClass() != o.getClass()) {
            return 1;
        }
        return 0;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        return super.hashCode();
    }


}
